{%extends 'layout.html'%}
{%block content%}
<div>
    {%for content in contents%}
    <h1>{{content.title}}</h1>
    <p>
        作者： <span>{{content.user.username}}</span>
        时间：<span>{{content.addTime|date('Y年m月d日 H:i:s',-8*60)}}</span>
        阅读：<span>{{content.views}}</span>
        评论：<span>10</span>
    </p>
    <dfn><p>{{content.description}}</p></dfn>
    <a href="/view?contentid={{content.id}}">阅读全文</a>
    {%endfor%}
</div>
<div class="mt50">
    <div>
        {%if page<=1%}
        <a href="javascript:;">没有上一页了</a>
        {%else%}
        <a href="/?category={{category}}&page={{page-1}}">上一页</a>
        {%endif%}

        {%if pages>0%}
        <strong>{{page}}/{{pages}}</strong>
        {%else%}
        {%endif%}
        {%if page>=pages%}
        <a href="javascript:;">没有下一页了</a>
        {%else%}
        <a href="/?category={{category}}&page={{page*1+1}}">下一页</a>
        {%endif%}
    </div>

</div>
{%endblock%}